home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ptv3n5.zip / SIMPLDLL.PAS < prev    next >
Pascal/Delphi Source File  |  1992-01-29  |  959b  |  37 lines

  1. {Three Myths, figure 1.  Copyright ⌐ 1992, Jon Shemitz}
  2.  
  3. library SimplDLL; {Sample export shells for an object oriented DLL}
  4.  
  5. uses    SimplObj; {Exports objects from the SimplObj unit}
  6.  
  7. function Simple_Setup( Code: word;
  8.                VMT: word; var Self): pointer; export;
  9. type    Cast = function (Code: word; VMT: word; var Self): pointer;
  10. const    MethodPtr: pointer = @ Simple.Setup;
  11. begin
  12.       Simple_Setup := Cast(MethodPtr)(Code, VMT, Self);
  13. end;
  14.  
  15. exports Simple_Setup index 1;
  16.  
  17. procedure Simple_Teardown(VMT: word; var Self); export;
  18. type    Cast = procedure (VMT: word; var Self);
  19. const    MethodPtr: pointer = @ Simple.Teardown;
  20. begin
  21.     Cast(MethodPtr)(VMT, Self);
  22. end;
  23.  
  24. exports Simple_Teardown index 2;
  25.  
  26. procedure Simple_Method(var Data; var Self); export;
  27. type    Cast = procedure (var Data; var Self);
  28. const    MethodPtr: pointer = @ Simple.DoSomething;
  29. begin
  30.     Cast(MethodPtr)(Data, Self);
  31. end;
  32.  
  33. exports Simple_Method index 3;
  34.  
  35. begin
  36. end.
  37.